package com.example.webdemo.dao;

import com.example.webdemo.model.ArticlePopularity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticlePopularityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ArticlePopularity row);

    int insertSelective(ArticlePopularity row);

    ArticlePopularity selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ArticlePopularity row);

    int updateByPrimaryKey(ArticlePopularity row);

    List<ArticlePopularity> selectAll();
    ArticlePopularity selectByEndorseIdAndType(@Param("articleInfoId") Integer articleInfoId,@Param("endorseId") Integer endorseId, @Param("endorseType") Integer endorseType);

    Integer selectByUserIdAndType(@Param("userId") Integer userId, @Param("endorseType") Integer endorseType);

    Integer deleteByArticleIdAndType(@Param("articleInfoId") Integer articleInfoId,@Param("endorseId") Integer endorseId, @Param("endorseType") Integer endorseType);

    List<Integer> selectByUserIdAndTypeIds(@Param("userId") Integer userId, @Param("endorseType") Integer endorseType);
}